const path = require("path");
const poststylus = require("poststylus");
const pxtorem = require("postcss-pxtorem");
const resolve = file => path.resolve(__dirname, file);

module.exports = {
  devServer: {
    open: true, //浏览器自动打开页面
    proxy: {
      api: {
        //你要跨域的域名(包含host、端口号,切记：一定要带上http头);
        //同一个域名只能设置一次跨域，否则重复报错！
        // target: "http://192.168.0.114:80/xhlg/public",
        target: "http://cx.hrycf.com",
        // target: "http://127.0.0.1:8086",
        // target: 'http://xhlg.azaiyun.com/',
        changeOrigin: true, //是否跨域，设置为true;(必须)
        pathRewrite: {
          "^/api": "" //需要rewrite的,
        }
      }
    }
  },
  css: {
    loaderOptions: {
      stylus: {
        use: [
          poststylus([
            pxtorem({
              rootValue: 30,
              propWhiteList: [],
              minPixelValue: 2
            }),
            "autoprefixer"
          ])
        ],
        import: [
          resolve("./src/style/theme.custom"),
          resolve("./src/style/mixin")
        ]
      }
    }
  },
  transpileDependencies: ["mand-mobile"],
  publicPath: "./",
  outputDir: "hryData"
};
